import { Controller, Get, Query } from "@nestjs/common";
import { ClashService } from "./clash.service";


@Controller("/clash")
export class ClashController {
  constructor(
    private readonly clashService: ClashService
  ) {}
  @Get("fetch_config")
  fetchConfig() {
    return this.clashService.fetchConfig()
  }
  
  @Get("switch_proxy")
  switchProxy(@Query() query: {key: string}) {
    return this.clashService.switchProxy(query.key)
  }

  @Get("check_delay")
  checkDelay(@Query() query: {key: string}) {
    return this.clashService.checkDelay(query.key)
  }

  @Get("start_process")
  startProcess() {
    return this.clashService.startClashProcess()
  }

  @Get("ip")
  getIp() {
    return this.clashService.getIp()
  }
}